<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>红包记录</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link rel="stylesheet" href="../css/mui.min.css">
		<link rel="stylesheet" href="../css/common.css" />
		<link rel="stylesheet" href="../css/iconfont.css" />
	</head>

	<body>

		<style>
			[v-cloak] {
				display: none;
			}
			
			html,
			body {
				height: 100%;
				background-color: white;
			}
			
			.mui-bar-nav {
				background: #f16456;
				height: 58px;
			}
			
			.mui-bar .mui-title {
				margin-top: 18px;
			}
			
			.mui-bar-nav~.mui-content {
				padding-top: 58px;
			}
			
			.mui-action-back,
			.mui-title,
			.mui-action-back:active {
				color: #FFFFFF!important;
				margin-top: 17px;
			}
			
			.mui-content {
				height: 100%;
			}
			
			.mui-content>.mui-table-view:first-child {
				margin-top: 0px;
			}
			
			.mui-media-body .amount {
				float: right;
				padding: 8px 20px 0px 0px;
				color: #f16456;
				font-size: 18px;
			}
		</style>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">红包记录</h1>
		</header>
		<div class="mui-content" id="bizVue" v-cloak>
			<ul class="mui-table-view">
				<li class="mui-table-view-cell mui-media" v-for="item in list">
					<a class="mui-navigate-right" @click="detail(item)">
						<img class="mui-media-object mui-pull-left" :src="item.headImg" width="60" height="60">
						<div class="mui-media-body">
							{{item.nickname}}
							<span class="mui-badge mui-badge-danger" v-if="item.myGrabAmount == null">发红包</span>
							<span class="mui-badge mui-badge-danger" v-if="item.isLandmine == 1">雷</span>
							<span class="mui-badge mui-badge-success" v-if="item.isLandmine == 1">{{item.landmineAmount}}</span>
							<span class="amount">￥{{item.myGrabAmount == null ? item.amount : item.myGrabAmount}}</span>
							<h6>{{item.createTime.substr(5,11)}}</h6>
						</div>
					</a>
				</li>
			</ul>
		</div>
		<script src="../js/mui.min.js"></script>
		<script src="../js/vue.min.js"></script>
		<script type="text/javascript" src="../js/public.js"></script>
		<script type="text/javascript" src="../js/jquery-1.8.3.min.js"></script>
		<script>
			mui.init({
				pullRefresh: {
					container: '#bizVue',
					up: {
						auto: true,
						contentrefresh: '正在加载...',
						callback: function() {
							vm.loadData();
						}
					}
				}
			});
			var vm = new Vue({
				el: '#bizVue',
				data: {
					list: [],
					page: 1
				},
				mounted: function() {
					mui.plusReady(function() {
						swipeBack();
					});
				},
				methods: {
					loadData: function() {
						mui.postParam(PacketList, {
							"page": vm.page,
							"limit": 20
						}, function(result) {
							if(result.code == 0) {
								vm.list = vm.list.concat(result.page.list);
								vm.page = result.page.currPage + 1;
								mui('#bizVue').pullRefresh().endPullupToRefresh((result.page.currPage >= result.page.totalPage));
							} else {
								mymui(result.msg);
							}
						});
					},
					detail: function(curItem) {
						mui.openWindow({
							id: 'my-packet-detail',
							url: 'my-packet-detail.html',
							extras: {
								item: curItem
							},
							waiting: {
								autoShow: false
							}
						});
					}
				}
			});
		</script>

	</body>

</html>